<?xml version="1.0"?>
<!--
/**
 * Magento
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Academic Free License (AFL 3.0)
 * that is bundled with this package in the file LICENSE_AFL.txt.
 * It is also available through the world-wide-web at this URL:
 * http://opensource.org/licenses/afl-3.0.php
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@magentocommerce.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade Magento to newer
 * versions in the future. If you wish to customize Magento for your
 * needs please refer to http://www.magentocommerce.com for more information.
 *
 * @category   design_default
 * @package    Mage
 * @copyright  Copyright (c) 2008 Irubin Consulting Inc. DBA Varien (http://www.varien.com)
 * @license    http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
 */

-->
<layout version="0.1.0">

<!--
Default layout, loads most of the pages
-->

    <default>
        <!-- Mage_Tag -->
        <reference name="right">
            <block type="tag/popular" name="tags_popular" template="tag/popular.phtm">
                <action method="setTemplate"><template>tag/popular.phtml</template></action>
            </block>
        </reference>

    </default>

<!--
Customer account pages, rendered for all tabs in dashboard
-->

    <customer_account>
        <!-- Mage_Tag -->
        <reference name="customer_account_navigation">
            <action method="addLink" translate="label" module="tag"><name>tags</name><path>tag/customer/</path><label>My Tags</label></action>
        </reference>
    </customer_account>

<!--
Customer account home dashboard layout
-->

    <customer_account_index>
        <!-- Mage_Tag -->
        <reference name="customer_account_dashboard">
            <action method="unsetChild"><name>customer_account_dashboard_info2</name></action>
            <block type="tag/customer_recent" name="customer_account_dashboard_info2" as="info2" template="tag/customer/recent.phtml"/>
        </reference>
    </customer_account_index>

    <catalog_product_view>
         <!-- Mage_Tag -->
        <reference name="product.info.additional">
            <block type="tag/product_list" name="product_tag_list" before="-" template="tag/list.phtml"></block>
        </reference>
    </catalog_product_view>

<!--
All tags page
-->

    <tag_list_index>
        <!-- Mage_Tag -->
        <reference name="root">
            <action method="setTemplate"><template>page/2columns-right.phtml</template></action>
        </reference>
        <reference name="content">
            <block type="tag/all" name="tags_all" template="tag/cloud.phtml"/>
        </reference>
    </tag_list_index>

    <tag_product_list>
        <!-- Mage_Tag -->
        <reference name="content">
            <block type="tag/product_result" name="tag_products" template="catalogsearch/result.phtml">
                <block type="catalog/product_list" name="search_result_list" template="catalog/product/list.phtml"></block>
                <action method="setListOrders"/>
                <action method="setListModes"/>
                <action method="setListCollection"/>
            </block>
        </reference>
    </tag_product_list>

    <tag_customer_index>
        <update handle="customer_account"/>
        <reference name="root">
            <action method="setHeaderTitle" translate="title" module="customer"><title>My Account</title></action>
        </reference>
        <reference name="content">
            <block type="tag/customer_tags" name="customer_tags" template="tag/customer/tags.phtml"/>
         </reference>
    </tag_customer_index>

    <tag_customer_view>
        <update handle="customer_account"/>
        <reference name="root">
            <action method="setHeaderTitle" translate="title" module="customer"><title>My Account</title></action>
        </reference>
        <reference name="content">
            <block type="tag/customer_view" name="customer_view" template="tag/customer/view.phtml"/>
        </reference>
    </tag_customer_view>

    <tag_customer_edit>
        <update handle="customer_account"/>
        <reference name="root">
            <action method="setHeaderTitle" translate="title" module="customer"><title>My Account</title></action>
        </reference>
        <reference name="content">
            <block type="tag/customer_edit" name="customer_edit" template="tag/customer/edit.phtml"/>
        </reference>
    </tag_customer_edit>
</layout>